<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
</head>
<body>
<table class="table table-striped table-hover table-bordered table-responsive">
    <tr>
        <th>部门</th>
        <th>成员</th>
        <th>计划</th>
        <th>状态</th>
        <th>总结</th>
        <th>评价</th>

    </tr>


    <#list umap as uMap>

    <tr>

        <td>${uMap.deptName}</td>
        <td>${uMap.userName}</td>
        <td>
            <div>【${uMap.label}】${uMap.title}</div>
            <div>${uMap.planContent}
                <#if uMap.attachId??>
                <a style="color:#337ab7;" href="down?paid=${uMap.attachId}">
                        <span class="glyphicon glyphicon-paperclip"></span>
                </#if></div>


        </td>
        <td>
                <span class="label ${uMap.statusColor}">
                    ${uMap.statusName}</span>


        </td>

        <td>${uMap.planSummar!''}</td>

        <td>

            <!-- 模态框按钮 -->
            <a class="btn thisa" id="${uMap.planId}">
											<span class="label label-success ">
											<i class="glyphicon glyphicon-commenting">
											评论</i>
											</span>
            </a>
            <div>【${uMap.userName}】
                <#if uMap.planComment??>${(uMap.planComment)!''}</#if>
            </div>
        </td>


        </#list>
    </tr>

</table>
<#include "/common/paging.ftl">
<#include "/common/comment.ftl">

<script>
    $('.thisa').on('click', function () {
        $("#myModal").modal("toggle");
        $("#commentid").val($(this).attr("id"))
    });

    var start = $("#start").text();
    var end = $("#end").text();

    //评论提交
    $("#commentsave").click(function () {
        var $comment = $("#comment").val();
        var $commentid = $("#commentid").val();

        $.ajax({
            type: "get",
            url: "updatecomment",
            data: {
                pid: $commentid,
                comment: $comment,
                starttime: '${(starttime)!''}',
                endtime: '${(endtime)!''}',
                choose: '${(choose)!''}'
            },
            success: function (dates) {
                $(".fade").hide();
                $(".close").click();
                $("#refresh").html(dates);
            },
            error: function () {
            }
        })
    })
    $("#commentsave").click(function () {
            var comment = $("#comment").val();
            var commentid = $("#commentid").val();
            location.href = "updatecomment?pid=" + commentid + "&comment=" + comment;
        }
    )

</script>
</body>
</html>